function uploadHeadImage() {
    $.ajaxFileUpload({
        url: "/multipleSave",             //需要链接到服务器地址
        secureuri: false,
        type: "post",
        fileElementId: 'headImage',                         //文件选择框的id属性
        dataType: 'text',
        success: function (data, status) {
            var start = data.indexOf("{");
            var end = data.indexOf("}");
            var str = data.substring(start, end + 1);
            var result = JSON.parse(str);
            if (result.code==0){
                $("#photo").attr("src",result.data);
                var html='<div id="tip" class="weui-toptips bg-success weui-toptips_visible" style="display: block;">上传成功,提交则改变头像</div>';
                $("#body").append(html);
                $("#myheadImage").val(result.data);
            }
        }
});
}

function tip_disappear() {
    $("#tip").remove();
}


//选择图片
function choose() {
    document.getElementById("headImage").click();
}